﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SMP.Service
{
    using SMP.Resource;
    using SMP.Domain;
    using System.Data;

    public class Nhaphang_Service
    {
        Kho_Res _objKho = new Kho_Res();
        Phieunhap_Res _objPhieunhap = new Phieunhap_Res();
        Nha_Cungcap_Res _objNha_Cungcap = new Nha_Cungcap_Res();
                
        #region Phiếu nhập

        public DataTable GetAll_Phieunhap()
        {
            return _objPhieunhap.GetAll_Phieunhap();
        }

        public DataTable Get_Phieunhap_Check_Used_By_Id_Phieunhap(object id_phieunhap)
        {
            return _objPhieunhap.Get_Phieunhap_Check_Used_By_Id_Phieunhap(Convert.ToInt64("0" + id_phieunhap));
        }

        public bool Delete_Phieunhap(object id_phieunhap)
        {
            return _objPhieunhap.Delete_Phieunhap(Convert.ToInt64("0" + id_phieunhap));
        }

        public DataTable Insert_Phieunhap(Phieunhap phieunhap)
        {
            return _objPhieunhap.Insert_Phieunhap(phieunhap);
        }

        public bool Update_Phieunhap(Phieunhap phieunhap)
        {
            return _objPhieunhap.Update_Phieunhap(phieunhap);
        }


        #endregion


        #region Phiếu nhập chi tiết

        public DataTable GetAll_Mathang_By_Id_Phieunhap(object id_phieunhap)
        {
            return _objPhieunhap.GetAll_Mathang_By_Id_Phieunhap(id_phieunhap);
        }

        public DataTable Get_Phieunhap_Check_Used_Xuathang_By_Id_Phieunhap(object id_phieunhap)
        {
            return _objPhieunhap.Get_Phieunhap_Check_Used_Xuathang_By_Id_Phieunhap(Convert.ToInt64("0" + id_phieunhap));
        }

        public bool Update_Phieunhap_Chitiet_Collection(DataTable dtb, object id_phieunhap, string action = "Insert")
        {
            return _objPhieunhap.Update_Phieunhap_Chitiet_Collection(dtb, id_phieunhap, action);
        }

        #endregion


        #region Nhà cung cấp

        
        public DataTable GetAll_Nha_Cungcap()
        {
            return _objNha_Cungcap.GetAll_Nha_Cungcap();
        }

        public bool Get_Nha_Cungcap_Check_Used_By_Id_Nha_Cungcap(object id_nha_cungcap)
        {
            return _objNha_Cungcap.Get_Nha_Cungcap_Check_Used_By_Id_Nha_Cungcap(Convert.ToInt64("0" + id_nha_cungcap));
        }

        public bool Delete_Nha_Cungcap(object id_nha_cungcap)
        {
            return _objNha_Cungcap.Delete_Nha_Cungcap(Convert.ToInt64("0" + id_nha_cungcap));
        }
        
        public bool Insert_Nha_Cungcap(Nha_Cungcap nha_cungcap)
        {
            return _objNha_Cungcap.Insert_Nha_Cungcap(nha_cungcap);
        }

        public bool Update_Nha_Cungcap(Nha_Cungcap nha_cungcap)
        {
            return _objNha_Cungcap.Update_Nha_Cungcap(nha_cungcap);
        }

        #endregion



        #region Kho

        public DataTable GetAll_Kho()
        {
            return _objKho.GetAll_Kho();
        }

        
        #endregion









    }
}
